package com.neusoft.neuiotms.dcom.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcom.dto.InspectionRuleProjectConcreteDTO;
import com.neusoft.neuiotms.dcom.model.InspectionRuleProjectConcrete;

@Component
public class InspectionRuleProjectConcreteConverter
        extends AbstractConverter<InspectionRuleProjectConcrete, InspectionRuleProjectConcreteDTO> {

    @Override
    public InspectionRuleProjectConcrete toModel(final InspectionRuleProjectConcreteDTO dto) {
        final InspectionRuleProjectConcrete model = new InspectionRuleProjectConcrete();
        model.setConcreteCode(dto.getConcreteCode());
        model.setConcreteName(dto.getConcreteName());
        return model;
    }

    @Override
    public InspectionRuleProjectConcreteDTO toDTO(final InspectionRuleProjectConcrete model,
            final boolean forListView) {
        final InspectionRuleProjectConcreteDTO dto = new InspectionRuleProjectConcreteDTO();
        dto.setId(model.getId());
        dto.setConcreteCode(model.getConcreteCode());
        dto.setConcreteName(model.getConcreteName());
        return dto;
    }

}
